<layout name='layout' />

<div class="admin-main">
	<blockquote class="layui-elem-quote">
		<a href="<{:U('Album/image',array('id'=>$album['id']))}>" class="layui-btn layui-btn-small">
			<i class="layui-icon">&#xe608;</i> 返回相册
		</a>
	</blockquote>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		<legend>上传图片【<{$album['title']}>】</legend>
	</fieldset>

	<form id="ajaxForm" class="layui-form" method="post" action="<{:U('Album/addimage')}>">
		<div class="layui-form-item">
			<label class="layui-form-label">标题</label>
			<div class="layui-input-block">
				<input type="text" name="title" lay-verify="required" placeholder="请输入标题" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">图片地址</label>
			<div class="layui-inline">
				<img class="thumb" id="picname_src" src="<{:STATICS}>/image/image.jpg" />
				<input type="hidden" name="picname" id="picname_url" />								
			</div>
			<div class="layui-inline">
				<input type="button" value="上传" class="layui-btn layui-btn-small" onclick="uploadfile('<{:U('Upload/image')}>','picname');"/>
				<input type="button" value="删除图片" class="layui-btn layui-btn-small" onclick="delImage('picname')"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">排序</label>
			<div class="layui-input-block">
				<input type="text" name="sort" id="sort" value="0" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">描述</label>
			<div class="layui-input-block">
				<textarea name="intr" class="layui-textarea"></textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
			</div>
		</div>
		<input type="hidden" name="albumID" value="<{$album['id']}>">
	</form>
</div>
<!--上传文件-->
<form style="display:none;" id='myupload' action="" method='post' enctype='multipart/form-data'>
<input id="fileupload" type="file" name="file">
</form>
<div id="uploading" style="display:none;">
	<div class="wrapper">
		<div class="load-bar">   
			<div class="load-bar-inner" data-loading="0"> <span id="counter">0%</span> </div> 
		</div>  
		<p>请等待... </p>
	</div>
</div>
<script>
$("#tempBtn").click(function(){
	$("#status").val("0");
	$("#ajaxForm").submit();
});
</script>